
global	v86r_eax:dword
global	v86r_ebx:dword
global	v86r_ecx:dword
global	v86r_edx:dword
global	v86r_esi:dword
global	v86r_edi:dword
global	v86r_ebp:dword
global	v86r_ah:byte
global	v86r_al:byte
global	v86r_bh:byte
global	v86r_bl:byte
global	v86r_ch:byte
global	v86r_cl:byte
global	v86r_dh:byte
global	v86r_dl:byte
global	v86r_ax:word
global	v86r_bx:word
global	v86r_cx:word
global	v86r_dx:word
global	v86r_si:word
global	v86r_di:word
global	v86r_bp:word
global	v86r_ds:word
global	v86r_es:word
global	v86r_fs:word
global	v86r_gs:word
global	_selcode:word
global	_seldata:word
global	_selzero:word
global	_lomembase:dword
global	_lomemtop:dword
global	_himembase:dword
global	_himemtop:dword
global	_pspa:dword
global	_code16a:dword
global	_code32a:dword
global	_getirqvect:dword
global	_setirqvect:dword
global	_sysbyte0:byte
global	_setselector:dword
global	_exitcode:byte

global	_getmem:near
global	_getlomem:near
global	_gethimem:near
global	_lomemsize:near
global	_himemsize:near
global	_ret:near
global	_exit:near
global	_getirqmask:near
global	_setirqmask:near
global	_rmpmirqset:near
global	_rmpmirqfree:near
global	_getselector:near
global	_freeselector:near

; Convert physical pointer to realative pointer
Move	macro reg, ptr
	mov &reg,&ptr
	sub &reg,_code32a
endm

; Convert relative pointer to physical pointer

@php	macro reg, ptr
	mov &reg,&ptr
	add &reg,_code32a
endm

; Output a byte to DX
@outb		macro	val
	mov al,&val
	out dx,al
endm

; Output a word to DX
@outw		macro	val
	mov ax,&val
	out dx,ax
endm


; Get interrupt flag status
@gif	macro
	mov ax,902h
	int 31h
endm

; Get interrupt flag status and clear
@gifc	macro
	mov ax,900h
	int 31h
endm

; Get interrupt flag status and set
@gifs	macro
	mov ax,901h
	int 31h
endm

; Get interrupt flag status and set to AL (0=clear, 1=set)
@gifal	macro
	mov ah,9
	int 31h
endm

